home *** CD-ROM | disk | FTP | other *** search
/ 500 MB Nyheder Direkte fra Internet 2 / 500 MB nyheder direkte fra internet CD 2.iso / start / data / text / operate.txt < prev    next >
Text File  |  1994-09-21  |  21KB  |  366 lines

  1.  
  2.              BACKGROUND
  3.   To begin operating a computer, you find its power switch, turn 
  4. it on, and then what?
  5.   What do you type? What do you do? How will the computer 
  6. respond?
  7.   The answers to those questions depend on which operating system 
  8. your computer uses.
  9.   Most IBM clones use an operating system called MS-DOS, 
  10. supplemented by Windows (which lets you more easily use a mouse). 
  11. Mac computers use a different operating system instead, called 
  12. the Mac System. This book explains how to use all three: MS-DOS, 
  13. Windows, and the Mac System.
  14.   Other kinds of computers use different operating systems 
  15. instead.
  16.  
  17.              Five issues
  18.   To judge which operating system is best for you, consider five 
  19. issues. . . . 
  20.   Hardware requirements Which hardware must you buy before you 
  21. run the operating system? Does the operating system run on a 
  22. cheap microcomputer, or does it require a computer that's more 
  23. expensive? If it requires an expensive computer, can you justify 
  24. the high cost? Which CPU chip is required? How much RAM? How much 
  25. space on the hard disk? Does it require a mouse?
  26.   Speed Does the operating system run quickly, or must you wait a 
  27. long time for it to obey your commands? After you've given a 
  28. command, do you spend a long time twiddling your thumbs, waiting 
  29. for the operating system to catch up to you? If the operating 
  30. system runs too slowly, maybe you'd get your work done faster if 
  31. you'd use an old-fashioned typewriter or calculator instead of a 
  32. computer!
  33.   Multitasking To what extent can the operating system handle 
  34. many people, tasks, and devices simultaneously? Can the operating 
  35. system begin working on a second task before the first task has 
  36. finished, so the operating system is working on both tasks 
  37. simultaneously? For example, while the operating system is making 
  38. the printer print and waits for the printer to finish printing, 
  39. can the operating system let you simultaneously use the keyboard, 
  40. so you can feed the computer further commands ___ and can the 
  41. operating system start obeying those commands, even though the 
  42. printer hasn't finished obeying your previous command yet?
  43.   User interface How do you feed commands to the operating system 
  44. and tell it what to do? Do you type the commands on the keyboard, 
  45. or are you supposed to use a mouse instead? Are the commands or 
  46. mouse-methods easy for you to remember, or must you keep 
  47. referring back to the instruction manual to remember how to use 
  48. the damned computer?
  49.   Program availability Think about your goal (why you bought the 
  50. computer and what kind of programs you want the computer to run), 
  51. and ask whether those kinds of programs have been written for 
  52. this operating system yet. For example, have programs been 
  53. written yet to make this operating system
  54. handle word processing, databases, spreadsheets, graphics, 
  55. desktop publishing, speech, music, multimedia, telecommunication, 
  56. networks, and accounting ___ and do those programs work 
  57. excellently, meet all your needs, and thrill you?
  58.  
  59.                                            Three kinds of user interface
  60.                                          How do you give commands 
  61. to the computer? The answer depends on what kind of user 
  62. interface the operating system uses. Three kinds of user 
  63. interface have been invented.
  64.                                          Command-driven In a 
  65. command-driven interface, you give commands to the computer by 
  66. typing the commands on the keyboard.
  67.                                          For example, MS-DOS uses 
  68. a command-driven interface. To command MS-DOS to copy a file, you 
  69. sit at the keyboard, type the word ``copy'', then type the 
  70. details about which file you want to copy and which disk you want 
  71. to copy it to. To command MS-DOS to erase a file so the file is 
  72. deleted, you type the word ``erase'' or ``del'', then type the 
  73. name of the file you want to delete.
  74.                                          Menu-driven In a 
  75. menu-driven interface, you act as if you were in a restaurant and 
  76. ordering food from a menu: you give orders to the computer by 
  77. choosing your order from a menu that appears on the screen.
  78.                                          For example, Pro DOS (an 
  79. operating system used on some Apple 2 computers) has a 
  80. menu-driven interface. When you start using Pro DOS, the screen 
  81. shows a menu that begins like this:
  82. 1.  Copy files
  83. 2.  Delete files
  84. If you want to copy a file, press the ``1'' key on the keyboard. 
  85. If you want to delete a file instead, press the ``2'' key. 
  86. Afterwards, the computer lets you choose which file to copy or 
  87. delete.
  88.                                          Icon-driven In an 
  89. icon-driven interface, the screen shows lots of cute little 
  90. pictures; each little picture is called an icon. To give orders 
  91. to the computer, you point at one of the icons by using a mouse, 
  92. then use the mouse to make the icon move or disappear or turn 
  93. black or otherwise change appearance.
  94.                                          For example, the Mac's 
  95. operating system (which is called the Mac System) has an 
  96. icon-driven interface. When you turn the Mac on, the screen gets 
  97. filled with lots of little icons.
  98.                                          If you want to copy a 
  99. file from the Mac's hard disk to a floppy disk, just use the 
  100. mouse! Point at the icon (picture) that represents the file, then 
  101. drag the file's icon to the floppy disk's icon. Dragging the 
  102. file's icon to the floppy's icon makes the computer drag the file 
  103. itself to the floppy itself.
  104.                                          One of the icons on the 
  105. screen is a picture of a trash can. To delete a file, drag the 
  106. file's icon to the trash-can icon. When you finish, the trash can 
  107. will bulge, which means the file's been deleted, thrown away.
  108.  
  109.                                                Multitasking methods
  110.                                          Our country is being run 
  111. by monsters! Big monster computers are running our government, 
  112. our banks, our insurance companies, our utility companies, our 
  113. airlines, our railroads, and other big businesses.
  114.   How do those big computers manage to handle so many people and 
  115. tasks simutaneously? Here are the methods used by those 
  116. maxicomputers ___ and by many minicomputers and microcomputers, 
  117. too. . . . 
  118.  
  119.          Scheduling the CPU
  120.   Suppose your organization buys a multi-million-dollar 
  121. maxicomputer. How can the employees all share it? The answer 
  122. depends on what kind of operating system you buy.
  123.   Why batch-processing was invented In the 1950's, the only kind 
  124. of operating system was single-user: it handled just one person 
  125. at a time. If two people wanted to use the computer, the second 
  126. person had to stand in line behind the first person until the 
  127. first finished.
  128.   The first improvement over single-user operating systems was 
  129. batch processing. In a batch-processing system, the second person 
  130. didn't have to stand in line to use the computer. Instead, he fed 
  131. his program onto the computer's disk (or other kind of memory) 
  132. and walked away. The computer ran it automatically when the first 
  133. person's program finished.
  134.   That procedure was called batch processing because the computer 
  135. could store a whole batch of programs on the disk and run them in 
  136. order.
  137.   Why multiprogramming was invented While running your program, 
  138. the CPU often waits for computer devices to catch up. For 
  139. example, if your program makes the printer print, the CPU waits 
  140. for the printer to finish. When the printer finishes, the CPU can 
  141. progress to your program's next instruction.
  142.   While the CPU is waiting for the printer (or another slow 
  143. device), why not let the CPU temporarily work on the next guy's 
  144. program? That's called multiprogramming, because the CPU switches 
  145. its attention among several programs.
  146.     In a simple multiprogramming system, the CPU follows this 
  147. strategy: it begins working on the first guy's program; but when 
  148. that program makes the CPU wait for a slow device, the CPU starts 
  149. working on the second program. When the second program makes the 
  150. CPU wait also, the CPU switches its attention to the third 
  151. program, etc. But the first program always has top priority: as 
  152. soon as that first program can continue (because the printer 
  153. finished), the CPU resumes work on that program and puts all 
  154. other programs on hold.
  155.   Why round-robin time-slicing was invented Suppose one guy's 
  156. program requires an hour of computer time, but another guy's 
  157. program requires just one minute. If the guy with the hour-long 
  158. program is kind, he'll let the other guy go first. But if he's 
  159. mean and shoves his way to the computer first, the other guy must 
  160. wait over an hour to run the one-minute program.
  161.   An improved operating system can ``psyche out'' the situation 
  162. and help the second guy without waiting for the first guy to 
  163. finish. Here's how the operating system works. . . . 
  164.   A jiffy is a sixtieth of a second. During the first jiffy, the 
  165. CPU works on the first guy's program. During the next jiffy, the 
  166. CPU works on the second guy's program. During the third jiffy, 
  167. the CPU works on a third guy's program, and so on, until each 
  168. program has received a jiffy. Then, like a card dealer, the CPU 
  169. ``deals'' a second jiffy to each program. Then it deals a third 
  170. jiffy, etc. If one of the programs requires little CPU time, it 
  171. will finish after being dealt just a few jiffies and ``drop out'' 
  172. of the game, without waiting for all the other players to finish.
  173.   In that scheme, each jiffy is called a time slice. Since the 
  174. computer deals time slices as if dealing to a circle of card
  175. players, the technique's called round-robin time-slicing.
  176.                                          To make that technique 
  177. practical, the computer must be attached to many terminals so 
  178. each guy has his own terminal. The CPU goes round and round, 
  179. switching its attention from terminal to terminal every jiffy.
  180.                                          If you sit at a 
  181. terminal, a few jiffies later the CPU gets to your terminal, 
  182. gives you its full attention for a jiffy, then ignores you for 
  183. several jiffies while it handles the other users, then comes back 
  184. to you again. Since jiffies are so quick, you don't notice that 
  185. the CPU ignores you for several jiffies.
  186.                                          That technique's an 
  187. example of timesharing, which is defined as ``an operating system 
  188. creating the illusion that the CPU gives you its full attention 
  189. continuously''.
  190.                                          In that system, you 
  191. might not get a full jiffy on your turn. For example, if your 
  192. program needs to use the printer, the CPU sends some data out to 
  193. the printer but then immediately moves on to the next person, 
  194. without waiting for the printer to catch up. When the CPU has 
  195. given all the other people their jiffies and returns to you 
  196. again, the CPU checks whether the printer has finished the job 
  197. yet.
  198.                                          Fewer switches While the 
  199. CPU works on a particular guy, the state of that guy's program is 
  200. stored in the CPU and RAM. When that guy's jiffy ends, the CPU 
  201. typically copies that guy's state onto the disk, then copies the 
  202. next guy's state from disk to the CPU and RAM. So every time the 
  203. CPU switches from one guy to the next, the CPU must typically do 
  204. lots of disk I/O (unless the CPU's RAM is large enough to hold 
  205. both guy's programs simultaneously).
  206.                                          Such disk I/O is 
  207. ``bureaucratic overhead''. It consumes lots of time. The only way 
  208. to reduce that overhead is to switch guys less often.
  209.                                          Let's develop a way to 
  210. make the CPU switch guys less often but still switch fast enough 
  211. to maintain each guy's illusion of getting continuous attention.
  212.                                          Suppose a guy's a ``CPU 
  213. hog'': he's running a program that won't finish for several 
  214. hours. Instead of giving him many short time slices, the CPU 
  215. could act more efficiently by totally ignoring him for several 
  216. hours (which will make everybody else in the computer room 
  217. cheer!) and then giving him a solid block of time toward the end 
  218. of those hours. He'll never know the difference: his job will 
  219. finish at the same time as it would otherwise. And the CPU will 
  220. waste less time in bureaucratic overhead, since it won't have to 
  221. switch attention to and from him so often.
  222.                                          To determine who's the 
  223. hog, the CPU counts how many jiffies and how much RAM each guy's 
  224. been using. If a guy's count is high, he's been acting hoggish 
  225. will probably continue to be a hog, so the CPU ignores him until 
  226. later, when he's given a solid block of time. If that block is 
  227. too long, the other guys will be ignored too long and think the 
  228. CPU broke; so that solid block should be just a few seconds. If 
  229. he doesn't finish within a few seconds, give him another block 
  230. later.
  231.                                          The Decsystem-20 and 
  232. other great timesharing systems use that strategy.
  233.                                          Distributed processing 
  234. Now you know how to make many people share a single CPU 
  235. efficiently. But since the CPU chip in an IBM PC costs just $3, 
  236. why bother sharing it? Why not simply give each guy his own CPU?
  237.                                          Today many companies are 
  238. abandoning maxicomputers that have fancy timesharing operating 
  239. systems and are replacing them by a collection of IBM PC clones, 
  240. each of which handles just one person at a time.
  241.                                          That's called 
  242. distributed processing: tying together many little CPU's instead 
  243. of forcing everybody to share one big CPU.
  244.         Scheduling the memory
  245.   Suppose your program is too big to fit in the RAM. What should 
  246. you do? The obvious answer: chop the program into little pieces, 
  247. and run one piece at a time.
  248.   Virtual memory If you buy a computer system that has virtual 
  249. memory, the operating system automatically chops your program 
  250. into little pieces, puts as many pieces as possible into the RAM, 
  251. and runs them. The remaining pieces are put on a disk instead. 
  252. When the CPU finishes processing the pieces in the RAM and needs 
  253. to get to the pieces on disk, the operating system automatically 
  254. fetches those pieces from the disk and copies them into the RAM 
  255. ___ after copying the no-longer-needed pieces from the RAM to the 
  256. disk.
  257.   Each piece of the program is called a page. On most computers, 
  258. each page is 4K. Copying a page from the disk to the RAM (or vice 
  259. versa) is called paging or swapping.
  260.   Multi-user RAM If many people try to share the RAM, the 
  261. operating system tries to squeeze all their programs into the RAM 
  262. simultaneously. If they won't all fit, the operating system 
  263. temporarily puts some of their programs onto disk until the other 
  264. programs are done (or have used up a time-slice).
  265.   If lots of users try to share a tiny RAM, the operating system 
  266. spends most of its time shuttling their programs from disk to RAM 
  267. and back to disk. That bad situation ___ in which the operating 
  268. system spends more time copying programs than running them ___ is 
  269. called thrashing, because the operating system is as helpless as 
  270. a fish out of water. If the operating system is big and 
  271. thrashing, it's called a beached whale. The only solution is to 
  272. buy more RAM or tell some of the users to go home!
  273.  
  274.          Scheduling the I/O
  275.   After the CPU sends a command to a slow device (such as a 
  276. printer or terminal), the CPU must wait for the device to obey. 
  277. While the CPU waits, it ought to do something useful ___ such as 
  278. processing somebody else's program, or processing a different 
  279. part of the same program.
  280.   Buffers Here's how the CPU handles the problem of waiting. When 
  281. the CPU wants to send a list of commands to a slow device, it 
  282. puts that list of commands into a buffer, which is a special part 
  283. of the RAM. The device peeks at the commands in the buffer. While 
  284. the device reads and obeys those commands, the CPU switches 
  285. attention to other programs or tasks.
  286.   The buffer's in RAM. But which RAM? In a traditional computer 
  287. system, the buffer's in the main RAM. In a more modern system, 
  288. each I/O device contains an auxiliary RAM, just big enough to 
  289. hold the device's buffer.
  290.   Buffers are used not just for printers and terminals but also 
  291. for disk drives and tape drives. Each slow device needs its own 
  292. buffer.
  293.   Spooling Suppose you share a maxicomputer with other users. 
  294. What if your program says to write answers on the printer, but 
  295. somebody else is still using the printer?
  296.   In that situation, the CPU pretends to obey your command: it 
  297. pretends to send your answers to the printer. But actually it 
  298. sends your answers to a disk instead. The CPU keeps watching the 
  299. printer: as soon as the other person finishes using the printer, 
  300. the CPU automatically copies your answers from the disk to the 
  301. printer and erases them from the disk.
  302.                                          That technique of 
  303. putting your answers temporarily on disk is called spooling; it's 
  304. handled by a part of the operating system called the spooler. 
  305. Spooling is used mainly for the printer but can also be used for 
  306. other output devices, such as the plotter. The word ``spool'' is 
  307. an abbreviation for ``Simultaneous Processing Of On-Line 
  308. devices''; spooling handles people who try simultaneously to use 
  309. the printer and other on-line devices.
  310.                                          If several people try to 
  311. use the printer simultaneously, the spooler stores all their 
  312. answers on disk temporarily and then prints those answers one a 
  313. time. The answers waiting on the disk are called the printer's 
  314. waiting-line or the printer's queue or (even more briefly) the 
  315. print queue. If the printer is slow and many people try to use it 
  316. simultaneously, the print queue can get quite long.
  317.                                          Suppose you want to use 
  318. the printer, but somebody else is using it to print paychecks. If 
  319. your operating system lacks a spooler, it says ``please wait for 
  320. the other person to finish'' or else makes a mess ___ by printing 
  321. your answers in the middle of the other person's paycheck! Moral: 
  322. get a spooler!
  323.  
  324.                                                     Personality
  325.                                          The operating system can 
  326. give the computer a personality, so the computer acts as a 
  327. conversationalist, a drudge, or a boss.
  328.                                          Conversationalist A 
  329. ``conversationalist'' is a computer you chat with by using a 
  330. keyboard and screen. The conversation might be about a computer 
  331. game you're playing, an airplane seat you're reserving, or your 
  332. personality (if the computer is trying to play therapist). 
  333. Throughout the conversation, what you say to the computer is 
  334. brief, and so are the computer's replies. Typically, you're 
  335. asking the computer for more output, or the computer's asking you 
  336. for more input.
  337.                                          Instead of calling such 
  338. a computer a ``conversationalist'', computists call it an 
  339. interactive computer. If it handles many programs simultaneously, 
  340. with each program on a different terminal, it's called a 
  341. timesharing computer. If its memory contains lots of data and it 
  342. answers questions about the data, it's called a data-retrieval 
  343. system or customer-inquiry system or commercial real-time system.
  344.                                          Drudge A ``drudge'' is a 
  345. computer that takes in piles of data and spits out piles of 
  346. answers. Traditionally, the data comes on cards (or forms that 
  347. are scanned), and the answers are printed on paper. While the 
  348. computer works, it asks you no questions; you don't need to chat 
  349. with it. It just does its job faithfully, blue-collar style.
  350.                                          If the drudge lets you 
  351. start feeding it a second program before the first program has 
  352. finished, it's a batch processor. If the batch processor starts 
  353. working on the second program before the first program has 
  354. finished, so that it's working on both programs simultaneously, 
  355. it's called a multiprogramming batch processor.
  356.                                          Boss A ``boss'' is a 
  357. computer that monitors another machine (such as a burglar-alarm 
  358. system, a microwave oven's timer, a series of synchronized 
  359. traffic lights, an electronic organ, a life-support system giving 
  360. periodic intravenous injections to an unconscious patient, or a 
  361. computerized asssembly line). The computer makes sure 
  362. everything's running smoothly. Typically, you don't see the 
  363. computer: it hides inside the machine it monitors.
  364.                                          Instead of calling such 
  365. a computer a ``boss'', computer ads call it a controller or a 
  366. scientific real-time system.